import { Entity, PrimaryGeneratedColumn, Column } from 'typeorm';
import { BaseEntity } from 'src/entities/base.entity';
@Entity()
export class GenTableColumn extends BaseEntity {
    @PrimaryGeneratedColumn({
        type: 'bigint',
        comment: '编号',
    })
    column_id: number;

    @Column({
        type: 'bigint',
        nullable:true,
        comment: '归属表编号',
    })
    table_id: number;

    @Column({
        type: 'varchar',
        length: 200,
        nullable:true,
        comment: '列名称',
    })
    column_name: string;

    @Column({
        type: 'varchar',
        length: 500,
        nullable:true,
        comment: '列描述',
    })
    column_comment: string;

    @Column({
        type: 'varchar',
        length: 100,
        nullable:true,
        comment: '列类型',
    })
    column_type: string;

    @Column({
        type: 'varchar',
        length: 100,
        nullable:true,
        comment: '列类型长度',
    })
    column_length:string;

    @Column({
        type: 'varchar',
        length: 100,
        nullable:true,
        comment: 'JS类型',
    })
    js_type: string;

    @Column({
        type: 'varchar',
        length: 100,
        nullable:true,
        comment: '列默认值',
    })
    column_default:string;

    @Column({
        type: 'char',
        length: 1,
        nullable:true,
        comment: '是否主键（1是）',
    })
    is_pk: string;

    @Column({
        type: 'char',
        length: 1,
        nullable:true,
        comment: '是否自增（1是）',
    })
    is_increment: string;

    @Column({
        type: 'char',
        length: 1,
        nullable:true,
        comment: '是否可以为null（YES是 NO否）',
    })
    is_nullable: string;


    @Column({
        type: 'char',
        length: 1,
        nullable:true,
        comment: '是否必填（1是）',
    })
    is_required: string;

    @Column({
        type: 'char',
        length: 1,
        nullable:true,
        comment: '是否为插入字段（1是）',
    })
    is_insert: string;

    @Column({
        type: 'char',
        length: 1,
        nullable:true,
        comment: '是否编辑字段（1是）',
    })
    is_edit: string;

    @Column({
        type: 'char',
        length: 1,
        nullable:true,
        comment: '是否列表字段（1是）',
    })
    is_list: string;

    @Column({
        type: 'char',
        length: 1,
        nullable:true,
        comment: '是否查询字段（1是）',
    })
    is_query: string;

    @Column({
        type: 'varchar',
        length: 200,
        nullable:true,
        comment: '查询方式(等于、不等于、大于、小于、范围)',
    })
    query_type: string;

    @Column({
        type: 'varchar',
        length: 200,
        nullable:true,
        comment: '显示类型（文本框、文本域、下拉框、复选框、单选框、日期控件）',
    })
    html_type: string;

    @Column({
        type: 'varchar',
        length: 200,
        nullable:true,
        comment: '字典类型',
    })
    dict_type: string;

    @Column({
        type: 'int',
        nullable:true,
        comment: '排序',
    })
    sort: number;
}